<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>krpano-editor</title>
    <% if (htmlWebpackPlugin.options.nodeModules) { %>
      <!-- Add `node_modules/` to global paths so `require` works properly in development -->
      <script>
        require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
      </script>
    <% } %>
    <script src="static/tour.js"></script>
    <style>
      @-ms-viewport {
        width: device-width;
      }
  
      @media only screen and (min-device-width: 800px) {
        html {
          overflow: hidden;
        }
      }
  
      html {
        height: 100%;
        overflow: hidden !important;
      }
  
      #pano {
        height: 100%;
        width: 100%;
      }
  
      body {
        position: relative;
        min-width: 1200px;
        overflow: auto;
        height: 100%;
        margin: 0;
        padding: 0;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 16px;
        color: #FFFFFF;
        background-color: #333;
      }
    </style>
  </head>
  <body>
    <div id="editor"></div>
    <div id="pano" class="column is-10">
      <noscript>
        <table style="width:100%;height:100%;">
          <tr style="vertical-align:middle;">
            <td>
              <div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div>
            </td>
          </tr>
        </table>
      </noscript>
      <script>

        embedpano({
          xml: '/panos/test/tour.xml',
          swf: '/panos/test/tour.swf',
          target: 'pano',
          html5: 'auto',
          mobilescale: 1.0,
          passQueryParameters: true
        })

        // 一个隐藏的input元素，用来监听赋值scene变化，并手动触发onchange事件，将数据发布出去
        function sceneListener (activeScene) {
          var myEvent = new Event('onchange')
          var dom_input = document.getElementById('sceneId')
          dom_input.value = activeScene

          function fun (event) {
            event.preventDefault()
          }

          dom_input.addEventListener('onchange', fun, false)
          dom_input.dispatchEvent(myEvent)
          dom_input.removeEventListener('onchange', fun, false)
        }
      </script>
    </div>
    <script>
      if (process.env.NODE_ENV !== 'development') window.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
      console.log(`process: ${process.env.NODE_ENV}`)
    </script>
  </body>
</html>
